import Vue from 'vue'
import VueRouter from 'vue-router'
import Mains from '../components/mains'
import {routerDemoList, routerList} from "@/router/router";

Vue.config.productionTip = false
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '_home',
        redirect: '/home',
        component: Mains,
        meta: {
            hideInMenu: true,
            notCache: true
        },
        children: [
            {
                path: '/home',
                name: 'home',
                meta: {
                    title: '首页',
                    icon: 'md-home'
                },
                component: () => import('../view/home/index')
            },
            ...routerDemoList,
            ...routerList

        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
